// import App from '@/App.vue';
import { App, defineAsyncComponent, Component } from 'vue';
// import * as ElementPlusIconsVue from '@element-plus/icons-vue'
export async function registerComponent(app: App<Element>) {
    // 注册element plus icon
    /* for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
        // console.log(key);        
        app.component(key, component as Component)
    } */
    // 手动注册view vue组件
    //  system
    await app.component('changepw', defineAsyncComponent(async () =>
        await import('@/views/system/Pw.vue')
    ));
    await app.component('SysMenu', defineAsyncComponent(async () =>
        await import('@/views/system/Menu.vue')
    ));
    await app.component('SysRoles', defineAsyncComponent(async () =>
        await import('@/views/system/Roles.vue')
    ));
    await app.component('SysActions', defineAsyncComponent(async () =>
        await import('@/views/system/Actions.vue')
    ));
    await app.component('SysUsers', defineAsyncComponent(async () =>
        await import('@/views/system/Users.vue')
    ));
    // basedata
    await app.component('CntrSizeCods', defineAsyncComponent(async () =>
        await import('@/views/basedata/cntrsizecod/CntrSizeCods.vue')
    ));
    await app.component('CntrTypeCods', defineAsyncComponent(async () =>
        await import('@/views/basedata/cntrtypecod/CntrTypeCods.vue')
    ));
    await app.component('CyCfs', defineAsyncComponent(async () =>
        await import('@/views/basedata/cycfs/CyCfs.vue')
    ));
    await app.component('CyCfsArea', defineAsyncComponent(async () =>
        await import('@/views/basedata/cycfsarea/CyCfsArea.vue')
    ));
    await app.component('Clients', defineAsyncComponent(async () =>
        await import('@/views/basedata/client/Clients.vue')
    ));
    await app.component('PlaceCod', defineAsyncComponent(async () =>
        await import('@/views/basedata/place/PlaceCod.vue')
    ));
    await app.component('DamCods', defineAsyncComponent(async () =>
        await import('@/views/basedata/damcod/DamCods.vue')
    ))
    // container
    await app.component('InPlans', defineAsyncComponent(async () =>
        await import('@/views/container/plan/InPlans.vue')
    ));
    await app.component('OutPlans', defineAsyncComponent(async () =>
        await import('@/views/container/plan/OutPlans.vue')
    ));
    /* await app.component('LeasePlans', defineAsyncComponent(async () =>
        await import('@/views/container/plan/LeasePlans.vue')
    ));
    await app.component('RentPlans', defineAsyncComponent(async () =>
        await import('@/views/container/plan/RentPlans.vue')
    )); */
    await app.component('CntrLeaseQuery', defineAsyncComponent(async () =>
        await import('@/views/container/cntrlease/CntrLeaseQuery.vue')
    ));
    await app.component('CntrLeaseReport', defineAsyncComponent(async () =>
        await import('@/views/container/cntrlease/CntrLeaseReport.vue')
    ));
    await app.component('Cntrs', defineAsyncComponent(async () =>
        await import('@/views/container/cntr/Cntrs.vue')
    ));
    await app.component('FixReplys', defineAsyncComponent(async () =>
        await import('@/views/container/cntr/FixReplys.vue')
    ));

    await app.component('Inventory', defineAsyncComponent(async () =>
        await import('@/views/container/cntr/Inventory.vue')
    ));
    await app.component('InventoryGroup', defineAsyncComponent(async () =>
        await import('@/views/container/cntr/InventoryGroup.vue')
    ));
    await app.component('InventoryCheck', defineAsyncComponent(async () =>
        await import('@/views/container/cntr/InventoryCheck.vue')
    ));
    await app.component('ReleaseForms', defineAsyncComponent(async () =>
        await import('@/views/container/plan/ReleaseForms.vue')
    ));
    await app.component('PortCntrStat', defineAsyncComponent(async () =>
        await import('@/views/container/cntr/PortCntrStat.vue')
    ));
    await app.component('BusiEcharts', defineAsyncComponent(async () =>
        await import('@/views/presentation/BusiEcharts.vue')
    ));
    // business
    await app.component('FeeTyp', defineAsyncComponent(async () =>
        await import('@/views/business/sys/FeeTyp.vue')
    ));
    await app.component('FeeCod', defineAsyncComponent(async () =>
        await import('@/views/business/feecod/FeeCod.vue')
    ));
    await app.component('Currency', defineAsyncComponent(async () =>
        await import('@/views/business/currency/Currency.vue')
    ));
    await app.component('ExchangeRate', defineAsyncComponent(async () =>
        await import('@/views/business/currency/ExchangeRate.vue')
    ));
    await app.component('Category', defineAsyncComponent(async () =>
        await import('@/views/business/category/Category.vue')
    ));
    await app.component('CategorySurplus', defineAsyncComponent(async () =>
        await import('@/views/business/category/CategorySurplus.vue')
    ));
    await app.component('Pays', defineAsyncComponent(async () =>
        await import('@/views/business/pay/Pays.vue')
    ));
    await app.component('PrePays', defineAsyncComponent(async () =>
        await import('@/views/business/prepay/PrePays.vue')
    ));
    await app.component('FeeEles', defineAsyncComponent(async () =>
        await import('@/views/business/sys/FeeEles.vue')
    ));
    await app.component('FeeMods', defineAsyncComponent(async () =>
        await import('@/views/business/sys/FeeMods.vue')
    ));
    await app.component('Protocols', defineAsyncComponent(async () =>
        await import('@/views/business/sys/Protocols.vue')
    ));
    await app.component('ProtocolRate', defineAsyncComponent(async () =>
        await import('@/views/business/protocolrate/ProtocolRate.vue')
    ));
    await app.component('Feedets', defineAsyncComponent(async () =>
        await import('@/views/business/feedet/Feedets.vue')
    ));
    await app.component('MonthFeeOpe', defineAsyncComponent(async () =>
        await import('@/views/business/monthfee/MonthFeeOpe.vue')
    ));
    await app.component('FeeAudit', defineAsyncComponent(async () =>
        await import('@/views/business/audit/FeeAudit.vue')
    ));
    await app.component('AuditCancel', defineAsyncComponent(async () =>
        await import('@/views/business/audit/AuditCancel.vue')
    ));
    await app.component('Invoices', defineAsyncComponent(async () =>
        await import('@/views/business/invoice/Invoices.vue')
    ));
    await app.component('CancelAuditInvoicePay', defineAsyncComponent(async () =>
        await import('@/views/business/invoice/CancelAuditInvoicePay.vue')
    ));
    await app.component('CancelAuditInvoiceFeedet', defineAsyncComponent(async () =>
        await import('@/views/business/invoice/CancelAuditInvoiceFeedet.vue')
    ));
    await app.component('FeedetReport', defineAsyncComponent(async () =>
        await import('@/views/business/report/FeedetReport.vue')
    ));
    await app.component('PanCunEcharts', defineAsyncComponent(async () =>
        await import('@/views/presentation/PanCunEcharts.vue')
    ));
    await app.component('FinanceReport', defineAsyncComponent(async () =>
        await import('@/views/business/report/FinanceReport.vue')
    ));
    await app.component('LeaseFeeReport', defineAsyncComponent(async () =>
        await import('@/views/business/report/LeaseFeeReport.vue')
    ));
    await app.component('CfsFeeReport', defineAsyncComponent(async () =>
        await import('@/views/business/report/CfsFeeReport.vue')
    ));
    await app.component('FeedetEcharts', defineAsyncComponent(async () =>
        await import('@/views/business/report/FeedetEcharts.vue')
    ));
    await app.component('FeeReportCfg', defineAsyncComponent(async () =>
        await import('@/views/business/reportcfg/FeeReportCfg.vue')
    ));
    // cfs
    await app.component('CfsCntrs', defineAsyncComponent(async () =>
        await import('@/views/cfs/cntr/CfsCntrs.vue')
    ));
    await app.component('CfsCntr', defineAsyncComponent(async () =>
        await import('@/views/cfs/cntr/CfsCntr.vue')
    ));
    await app.component('CfsGateOut', defineAsyncComponent(async () =>
        await import('@/views/cfs/cntr/CfsGateOut.vue')
    ));
    // trans
    await app.component('Contracts', defineAsyncComponent(async () =>
        await import('@/views/transport/contract/Contracts.vue')
    ));
    /* await app.component('CfsLeaseGateOut', defineAsyncComponent(async () =>
        await import('@/views/cfs/cntr/CfsLeaseGateOut.vue')
    ));
    await app.component('CfsRentGateIn', defineAsyncComponent(async () =>
        await import('@/views/cfs/cntr/CfsRentGateIn.vue')
    )); */
}

/* export async function registerComponentAsynv(app: App<Element>, component_name: string, component_path: string) {
    await app.component(component_name, defineAsyncComponent(async () =>
        await import(component_path)
    ))
} */